<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fn</title>
</head>
<body>
<script>
    function test() {
        var num = window.prompt('input');
        var str = '';
        for(var i=num.length; i>=0; i--){
            str += transfer(num[i]);
        }
        document.write(str);
    }
    test()
    function transfer(target) {
        switch (target){
            case "1":
                return "壹";
            case "2":
                return "贰";
            case "3":
                return "仨";
            case "4":
                return "肆";
            case "5":
                return "伍";
            case "6":
                return "陆";
            case "7":
                return "柒";
            case "8":
                return "捌";
            case "9":
                return "玖";
            case "0":
                return "零";
            default:
                return ""
        }
    }
</script>
</body>
</html>
